package cn.wizzer.app.web.modules.controllers.platform.user.view;

import cn.wizzer.app.crown.modules.services.ViewPointOrderService;
import cn.wizzer.framework.base.Result;
import com.alibaba.dubbo.config.annotation.Reference;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;


@IocBean
@At("/platform/user/order/view")
public class UserOrderViewController {

    @Inject
    @Reference
    private ViewPointOrderService viewPointOrderService;

    @At("/")
    @Ok("beetl:/platform/user/view/order/index.html")
    @RequiresPermissions("user.order.view.list")
    public void index() {

    }

    /**
     * 观点订单列表查询
     *
     * @param searchKeyword
     * @param searchDate
     * @param orderNo
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @At
    @Ok("json:full")
    @RequiresPermissions("user.order.view.list")
    public Object data(@Param("searchKeyword") String searchKeyword,
                       @Param("searchDate") String[] searchDate,
                       @Param("orderNo") String orderNo,
                       @Param("pageNumber") int pageNumber,
                       @Param("pageSize") int pageSize) {
        return Result.success().addData(viewPointOrderService.listPage(pageNumber, pageSize, searchKeyword, searchDate, orderNo));
    }

}
